using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
using System.Drawing;
using GameFramework;
using GameEngine;

namespace Projet_X0
{
    public class InterfaceMesh : IMesh
    {
        private Point position1;
        private Point position2;
        private Microsoft.DirectX.Direct3D.Font font = null;
        
        public InterfaceMesh()
        {
            position1 = new Point(0, 500);
            position2 = new Point(0, 550);
        }

        public override void Render()
        {
            Character.Health health = (Character.Health)((InterfaceEntity)owner.GetOwner()).GetPlayer().GetState((int)StatesID.Health);
            Character.Energy energy = (Character.Energy)((InterfaceEntity)owner.GetOwner()).GetPlayer().GetState((int)StatesID.Energy);
            font.DrawText(null, "Health :" + health.Get().ToString(), position1, Color.Blue.ToArgb());
            font.DrawText(null, "Energy :" + energy.Get().ToString(), position2, Color.Brown.ToArgb());
        }

        public override void Terminate()
        {
            font.Dispose();
        }

        public override void Init()
        {
            System.Drawing.Font dfont = new System.Drawing.Font(System.Drawing.FontFamily.GenericSansSerif, 15);
            font = new Microsoft.DirectX.Direct3D.Font(Display.grfDevice, dfont);
        }
        
        

    }
}
